package com.nus.services;

import com.nus.beans.User;

/**
 * Created by IntelliJ IDEA.
 * User: dell
 * Date: 9/23/12
 * Time: 8:06 PM
 * To change this template use File | Settings | File Templates.
 */
public class ValidationService {
    public boolean isEmpty(String str) {
        return str == null || str.isEmpty();
    }

    public boolean isNumber(String str) {
        boolean isNumber = true;
        try {
            Long.parseLong(str);
        } catch (Exception e) {
            isNumber = false;
        }
        return isNumber;
    }

    public boolean isGreaterThanZero(String str) {
        boolean isGreaterThanZero = false;
        try {
            long val = Long.parseLong(str);

            isGreaterThanZero = val >= 0;
        } catch (Exception e) {
            isGreaterThanZero = false;
        }
        return isGreaterThanZero;
    }

}
